/**
 * <copyright>
 * </copyright>
 *

 */
package ms.unicorn.language.languagedef.impl;

import ms.unicorn.language.languagedef.EntityDef;
import ms.unicorn.language.languagedef.LanguagedefPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Entity Def</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link ms.unicorn.language.languagedef.impl.EntityDefImpl#getSuperElement <em>Super Element</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class EntityDefImpl extends ElementDefImpl implements EntityDef
{
  /**
   * The cached value of the '{@link #getSuperElement() <em>Super Element</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getSuperElement()
   * @generated
   * @ordered
   */
  protected EntityDef superElement;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected EntityDefImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return LanguagedefPackage.Literals.ENTITY_DEF;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EntityDef getSuperElement()
  {
    if (superElement != null && superElement.eIsProxy())
    {
      InternalEObject oldSuperElement = (InternalEObject)superElement;
      superElement = (EntityDef)eResolveProxy(oldSuperElement);
      if (superElement != oldSuperElement)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, LanguagedefPackage.ENTITY_DEF__SUPER_ELEMENT, oldSuperElement, superElement));
      }
    }
    return superElement;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EntityDef basicGetSuperElement()
  {
    return superElement;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setSuperElement(EntityDef newSuperElement)
  {
    EntityDef oldSuperElement = superElement;
    superElement = newSuperElement;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, LanguagedefPackage.ENTITY_DEF__SUPER_ELEMENT, oldSuperElement, superElement));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case LanguagedefPackage.ENTITY_DEF__SUPER_ELEMENT:
        if (resolve) return getSuperElement();
        return basicGetSuperElement();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case LanguagedefPackage.ENTITY_DEF__SUPER_ELEMENT:
        setSuperElement((EntityDef)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case LanguagedefPackage.ENTITY_DEF__SUPER_ELEMENT:
        setSuperElement((EntityDef)null);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case LanguagedefPackage.ENTITY_DEF__SUPER_ELEMENT:
        return superElement != null;
    }
    return super.eIsSet(featureID);
  }

} //EntityDefImpl
